package com.adams.dcxt.bean;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 菜单表
 * 
 * @author 904912
 * 
 */
@Entity
@Table(name = "dcxt_dishes")
public class Dishes {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "dishes_id")
    private Long dishesId; // 主键

    @Column(name = "dishes_name", length = 100, nullable = false)
    private String dishesName;// 菜名

    @Column(name = "dishes_price", length = 11, nullable = false)
    private int dishesPrice; // 菜价

    @Column(name = "dishes_drscn", length = 500, nullable = true)
    private String dishesDrscn;// 描述

    @Column(name = "dishes_small_pic", length = 100, nullable = false)
    private String SmallPic;// 小图

    @Column(name = "dishes_big_pic", length = 100, nullable = false)
    private String bigPic;// 大图

    @Column(name = "dishes_ingredients", length = 300, nullable = true)
    private String ingredients;// 原料及配料

    @Column(name = "dishes_cook_time", length = 11, nullable = false)
    private int cookTime;// 做菜时长

    @Column(name = "dishes_recommend_flag", length = 11, nullable = false)
    private int recommendFlag = 0; // 是否推荐 0:不推荐,1:推荐

    @Column(name = "dishes_special_rate", length = 11, nullable = false)
    private String specialRate = "1";// 折扣率默认1

    @Column(name = "dishes_buy_count", length = 11, nullable = false)
    private int buyCount; // 订购排行

    @ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
    @JoinColumn(name = "dishes_taste_id", insertable = false, updatable = false)
    private Taste taste;

    @ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
    @JoinColumn(name = "dishes_type_id", insertable = false, updatable = false)
    private DishesType dishesType;

    public Long getDishesId() {
        return dishesId;
    }

    public void setDishesId(Long dishesId) {
        this.dishesId = dishesId;
    }

    public String getDishesName() {
        return dishesName;
    }

    public void setDishesName(String dishesName) {
        this.dishesName = dishesName;
    }

    public int getDishesPrice() {
        return dishesPrice;
    }

    public void setDishesPrice(int dishesPrice) {
        this.dishesPrice = dishesPrice;
    }

    public String getDishesDrscn() {
        return dishesDrscn;
    }

    public void setDishesDrscn(String dishesDrscn) {
        this.dishesDrscn = dishesDrscn;
    }

    public String getSmallPic() {
        return SmallPic;
    }

    public void setSmallPic(String smallPic) {
        SmallPic = smallPic;
    }

    public String getBigPic() {
        return bigPic;
    }

    public void setBigPic(String bigPic) {
        this.bigPic = bigPic;
    }

    public String getIngredients() {
        return ingredients;
    }

    public void setIngredients(String ingredients) {
        this.ingredients = ingredients;
    }

    public int getCookTime() {
        return cookTime;
    }

    public void setCookTime(int cookTime) {
        this.cookTime = cookTime;
    }

    public int getRecommendFlag() {
        return recommendFlag;
    }

    public void setRecommendFlag(int recommendFlag) {
        this.recommendFlag = recommendFlag;
    }

    public String getSpecialRate() {
        return specialRate;
    }

    public void setSpecialRate(String specialRate) {
        this.specialRate = specialRate;
    }

    public int getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(int buyCount) {
        this.buyCount = buyCount;
    }

    public Taste getTaste() {
        return taste;
    }

    public void setTaste(Taste taste) {
        this.taste = taste;
    }

    public DishesType getDishesType() {
        return dishesType;
    }

    public void setDishesType(DishesType dishesType) {
        this.dishesType = dishesType;
    }

}
